import 'package:proj_sfv/domain/Video.dart';

class MyAppState {
  int id = 0;
  String token = "";
  bool navigateBarHidden = false;
  int currentVideo = 0;
  MyAppState.initState() : id = 1, token = "13123";
  List<Video> videosCached = []; // 缓存的视频列表

  MyAppState(this.id, this.token, this.navigateBarHidden, this.currentVideo);
  factory MyAppState.setNavigateHidden(MyAppState myAppState) {
    return  MyAppState(myAppState.id, myAppState.token, !myAppState.navigateBarHidden, myAppState.currentVideo);
  }

  factory MyAppState.setCurrentVideo(MyAppState myAppState, int offset) {
    int index = offset + myAppState.currentVideo;
    index = index < 0 ? 0 : index;
    return MyAppState(myAppState.id, myAppState.token, myAppState.navigateBarHidden, index);
  }
}

class LoginAction {
  int id = 0;
  String token = "";
  LoginAction(this.id, this.token);
}

enum SystemActions {
  HideNavigateBar,
  NextVideo,
  PreVideo,
}

